{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sklearn import linear_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>City</th>\n",
       "      <th>Rent</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SF</td>\n",
       "      <td>3999</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SF</td>\n",
       "      <td>4000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SF</td>\n",
       "      <td>4001</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>NYC</td>\n",
       "      <td>3499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NYC</td>\n",
       "      <td>3500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NYC</td>\n",
       "      <td>3501</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Seattle</td>\n",
       "      <td>2499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Seattle</td>\n",
       "      <td>2500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Seattle</td>\n",
       "      <td>2501</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      City  Rent\n",
       "0       SF  3999\n",
       "1       SF  4000\n",
       "2       SF  4001\n",
       "3      NYC  3499\n",
       "4      NYC  3500\n",
       "5      NYC  3501\n",
       "6  Seattle  2499\n",
       "7  Seattle  2500\n",
       "8  Seattle  2501"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'City': ['SF', 'SF', 'SF', 'NYC', 'NYC', 'NYC', 'Seattle', 'Seattle', 'Seattle'],\n",
    "                   'Rent': [3999, 4000, 4001, 3499, 3500, 3501, 2499, 2500, 2501]})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rent</th>\n",
       "      <th>city_NYC</th>\n",
       "      <th>city_SF</th>\n",
       "      <th>city_Seattle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3999</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4000</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4001</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3499</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3500</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3501</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2499</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2500</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2501</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Rent  city_NYC  city_SF  city_Seattle\n",
       "0  3999         0        1             0\n",
       "1  4000         0        1             0\n",
       "2  4001         0        1             0\n",
       "3  3499         1        0             0\n",
       "4  3500         1        0             0\n",
       "5  3501         1        0             0\n",
       "6  2499         0        0             1\n",
       "7  2500         0        0             1\n",
       "8  2501         0        0             1"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "one_hot_df = pd.get_dummies(df, prefix=['city'])\n",
    "\n",
    "one_hot_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "lin_reg = linear_model.LinearRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.fit(one_hot_df[['city_NYC', 'city_SF', 'city_Seattle']], one_hot_df['Rent'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 166.66666667,  666.66666667, -833.33333333])"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3333.3333333333335"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# One-hot encoding weights + intercept\n",
    "w1 = lin_reg.coef_\n",
    "b1 = lin_reg.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3333.3333333333335"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Rent'].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rent</th>\n",
       "      <th>city_SF</th>\n",
       "      <th>city_Seattle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3999</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4000</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4001</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3499</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3500</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3501</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2499</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2500</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2501</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Rent  city_SF  city_Seattle\n",
       "0  3999        1             0\n",
       "1  4000        1             0\n",
       "2  4001        1             0\n",
       "3  3499        0             0\n",
       "4  3500        0             0\n",
       "5  3501        0             0\n",
       "6  2499        0             1\n",
       "7  2500        0             1\n",
       "8  2501        0             1"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dummy_df = pd.get_dummies(df, prefix=['city'], drop_first=True)\n",
    "dummy_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearRegression(copy_X=True, fit_intercept=True, n_jobs=1, normalize=False)"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.fit(dummy_df[['city_SF', 'city_Seattle']], dummy_df['Rent'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  500., -1000.])"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3500.0"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Dummy coding weights + intercept\n",
    "w2 = lin_reg.coef_\n",
    "b2 = lin_reg.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "effect_df = dummy_df.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Rent</th>\n",
       "      <th>city_SF</th>\n",
       "      <th>city_Seattle</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3999</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4000</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4001</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3499</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>3500</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>3501</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2499</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2500</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2501</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Rent  city_SF  city_Seattle\n",
       "0  3999      1.0           0.0\n",
       "1  4000      1.0           0.0\n",
       "2  4001      1.0           0.0\n",
       "3  3499     -1.0          -1.0\n",
       "4  3500     -1.0          -1.0\n",
       "5  3501     -1.0          -1.0\n",
       "6  2499      0.0           1.0\n",
       "7  2500      0.0           1.0\n",
       "8  2501      0.0           1.0"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "effect_df.loc[3:5, ['city_SF', 'city_Seattle']] = -1.0\n",
    "effect_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 666.66666667, -833.33333333])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.fit(effect_df[['city_SF', 'city_Seattle']], effect_df['Rent'])\n",
    "lin_reg.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3333.3333333333335"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lin_reg.intercept_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# illustration of rental price in cities\n",
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import matplotlib as mpl\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "sns.set(style=\"whitegrid\", font_scale=1.4, color_codes=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgQAAAFgCAYAAADEj2FHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtcVXW+//EXFwHFEi/AiCSTWEKIsHWogRomwstJg5lE\nz0yMt2owILVflzlKXgBTUUcTcwYbx0iljo2KitZMw1QeT1ORtgVmJ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z11lssWLCAX/7ylwDcfffd\nLF26lFOnTpGfn89DDz3EY4891unT+fnU1tby4YcfEhsbaxsLDAyktbWVr7/+GoCHH36Y+vp6tmzZ\nwuDBg23r+fr6UldXZ/d89fX13HLLLbZQUF9fz6233gpAW1sbZ86c6XSYQURERM7vW08qrK+v5847\n77Qt/+QnP6G6upo33niDF198kd/85jeXFAbg3DUIZs+ezWeffWYbO3z4MP369aN3794kJyfzxRdf\n8PLLLzNkyBC7bcPCwjh06JBtuampibKyMsLDw3F2diY0NNQu8ZSUlODi4kJwcPAl9SYiInK9+9ZA\n0NraSq9evWzLLi4uuLu7M3/+fO64447v9EIREREEBgYyb948Kioq2LdvH6tXryY5OZlNmzZx+PBh\nsrKy6NmzJ3V1ddTV1XHmzBkAEhISKC0tZf369Rw7doz58+fj5+dHZGQkAImJieTm5lJYWIjJZCIz\nM5OEhAQ8PT2/699DRETkunTJvzL4v0aMGPGdt+nRowcbNmwgMzOTyZMn4+npyfTp05k2bRoJCQm0\ntbUxY8YMu21GjhzJ1q1b8ff3Z926dWRlZfH8888TFhZGTk4Ozs7n8syECROorq4mIyMDi8XCmDFj\nmDdv3r8yNRERkeuSk9VqtV6oGBQUxLvvvku/fv1sYwaDgT179nDTTTc5pMEryWg06qRCERG5rlxo\n33fRbwgyMzNtZ/LDucMIK1assDuUAOd+kSAiIiLd07cGgoiICD7//HO7MYPBwJdffsmXX355RRsT\nERERx/nWQJCXl+eoPkRERKQLXfK9DEREROTapUAgIiIiCgQiIiKiQCAiIiIoEIiIiAgKBCIiIoIC\ngYiIiKBAICIiIigQiIiICAoEIiIiggKBiIiIoEAgIiIiKBCIiIgICgQiIiKCAoGIiIigQCAiIiIo\nEIiIiAgKBCIiIoICgYiIiKBAICIiIigQiIiICA4OBBUVFcyYMQODwUBMTAwbN2601aqrq3nooYcI\nDw/n3nvvZf/+/XbbFhUVERcXR1hYGFOnTqWystKunpeXR3R0NAaDgbS0NBobGx0yJxERkWuBwwJB\na2srSUlJDBw4kN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2MJDQ0lIyODXbt2cfbsWUdN\nT0REpFtzWCAYMmQIGzZswNPT0zbm5OREQ0MDRUVF3HHHHXh5edlqixcvZtasWQCUlpYSERFhq/Xs\n2ZOQkBCKi4tpb2/HZDLZ1cPDw2lvb6e8vNwBMxMREen+HBYI+vXrR1RUlG25o6ODl156iaioKKqq\nqvDz82PNmjX89Kc/ZcKECWzfvt22bl1dHT4+PnbP179/f2pra2loaKClpcWu7urqipeXFzU1NVd+\nYiIiItcA16564aysLMrLy9mxYwdLly6loKCAsWPH8vvf/56ysjIWL15M3759GT16NE1NTbi5udlt\n7+bmhsViobm52bZ8vvrFGI3GyzcpERGRbsrhgcBqtbJ06VK2bt3K2rVrueWWW3BxceHGG2/kmWee\nwcXFheHDh3PkyBG2bt3K6NGjcXd377Rzt1gseHl54e7ublv+Zt3Dw+Oi/YwaNeryTU5EROQqd6EP\nwg792WFHRwdPP/00r7zyCmvWrGH06NEA+Pj4EBAQgIuLi23dm2++mVOnTgHg6+tLXV2d3XPV19fj\n7e1tCwX19fW2WltbG2fOnOl0mEFERETOz6GBYPny5ezdu5d169YxduxY27jBYODo0aO0trbaxo4d\nO8agQYMACAsL49ChQ7ZaU1MTZWVlhIeH4+zsTGhoqF3iKSkpwcXFheDgYAfMSkREpPtzWCAoKSlh\n8+bNzJkzh+HDh1NXV2d7jB8/HldXVxYsWMAnn3xCQUEBO3fuJDExEYCEhARKS0tZv349x44dY/78\n+fj5+REZGQlAYmIiubm5FBYWYjKZyMzMJCEhwe4XDSIiInJhTlar1eqIF1qxYgW5ubnnrR0+fJiq\nqioWL16M0WjE29ublJQUJk+ebFtn//79ZGVlYTabCQsLY8mSJQwePNhW37BhA5s2bcJisTBmzBjS\n09Mveg6B0WjUOQQiInJdudC+z2GB4GqkQCAiItebC+37dHMjERERUSAQERERBQIRERFBgUBERERQ\nIBAREREUCERERAQFAhEREUGBQERERFAgEBGRbsLa0UFDWTlffXTUbry9pYXWL7+0GztTUsqn+bv4\n6ujHjmyxW3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FF0tPTeeCBB/j8889xd3fH09OT9957\njxkzZvDmm2/i7+/f1VMQua7pSoUiclmsXbuWjz76iFdffZWBAwfaxufOnUtraysrV65k3LhxdvfG\n0OcRkauHviEQke+ttbWVu+66i/j4eObPn9+p/vnnn1NZWcnw4cMZN24ccXFxREVFMW3aNNs6s2bN\n4s033+TWW29l5cqVtvEPPviAqVOn8tZbb9kFDRG5vHQOgYh8bydPnuTMmTOMHDnyvPV+/fphMBjo\n0aOHbcxgMJCdnQ2cu73xQw89xKRJk/jb3/5GY2Ojbb1du3YRFRWlMCByhSkQiMj39uWXXwLQp0+f\nS97Gzc3Ntn6/fv3w9PQkLi6O9vZ2CgsLgXO3Pn799ddJSEi4/E2LiB0FAhH53v55XsCZM2e+1/P0\n6dOHMWPGUFBQAEBhYSEuLi6MHj36e/coIt9OgUBEvrebbrqJAQMGcOjQofPWq6urmT59OqWlpRd9\nrkmTJlFUVERtbS0FBQXcd999uLm5Xe6WReQbFAhE5HtzdnZm0qRJ7Ny5E7PZ3Kmem5vLoUOHuOmm\nm+zGnZycOq374x//GD8/P3bu3ElRURETJ068Yn2LyP9SIBCRyyI5OZkhQ4aQmJjI7t27qaqqwmQy\nkZ6ezksvvcSiRYvsfnII4OnpCUB5eTlfffUVcC4kTJw4keeff57AwECGDx/u8LmIXI8UCETksujZ\nsyd5eXlMmjSJjRs38rOf/Yxf//rXVFZWkpuby+TJkzttExQUxD333MPjjz/Oc889ZxufOHEizc3N\nOplQxIF0HQIRueoUFxczbdo0/vu//5u+fft2dTsi1wVdqVBErhoVFRUcPXqUDRs2EBcXpzAg4kA6\nZCAiV43KykrS0tLw9PTkN7/5TVe3I3Jd0SEDERER0TcEIiIiokAgIiIiKBCIiIgICgQiIiKCAoGI\niIigQCAiIiLA/wdBvZzPUSdAXgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11d538b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.swarmplot(x=\"City\", y=\"Rent\", data=df);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "One-hot encoding weights:  [ 166.66666667  666.66666667 -833.33333333]  and intercept:  3333.33333333\n",
      "Dummy encoding weights:  [  500. -1000.]  and intercept:  3500.0\n"
     ]
    }
   ],
   "source": [
    "print('One-hot encoding weights: ' ,w1, ' and intercept: ', b1)\n",
    "print('Dummy encoding weights: ' ,w2, ' and intercept: ', b2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 265,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[4000.0, 4000.0, 4000.0, 3500.0, 3500.0, 3500.0, 2500.0, 2500.0, 2500.0]\n",
      "[3999.9999999999995, 3999.9999999999995, 3999.9999999999995, 3500.0, 3500.0, 3500.0, 2500.0, 2500.0, 2500.0]\n"
     ]
    }
   ],
   "source": [
    "# geometry of one-hot vs. dummy encoding\n",
    "\n",
    "# Create a list of values in the best fit line for one-hot encoding\n",
    "one_hot_y = [((w1[0] * one_hot_df.city_NYC[i]) + \n",
    "              (w1[1] * one_hot_df.city_SF[i]) +\n",
    "              (w1[2] * one_hot_df.city_Seattle[i]) + b1) \n",
    "             for i in range(0,one_hot_df.shape[0])]\n",
    "\n",
    "# Create a list of values in the best fit line for dummy coding\n",
    "dummy_y = [((w2[0] * dummy_df.city_SF[i]) +\n",
    "            (w2[1] * dummy_df.city_Seattle[i]) + b2)\n",
    "           for i in range(0,dummy_df.shape[0])]\n",
    "\n",
    "print(one_hot_y)\n",
    "print(dummy_y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
